﻿using System;
using System.Collections.Generic;
using System.Text;


using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;
using OT.Module.ModelConst;
using OT.Common;
using OT.EntLib.Validate;

namespace OT.Module.Model
{

    [Persistent(GDB.Org_DepPosition)]
    public class Org_DepPosition : XPLiteObject
    {
        #region ~

        public Org_DepPosition()
            : base(new Session())
        {

        }

        public Org_DepPosition(Session s)
            : base(s)
        {
        }

        public Org_DepPosition(Session s, XPClassInfo info)
            : base(s, info)
        {
        }

        #endregion


        #region ID
        private string _ID = "";

        [Key(false)]

        public string ID
        {
            get
            {
                return _ID;
            }
            set
            {
                SetPropertyValue("ID", ref _ID, value);
            }
        }
        #endregion


        #region Org_DepPosiEmpls
        [Association("Org_DepPosition-Org_DepPosiEmpls", typeof(Org_DepPosiEmpl))]
        public XPCollection<Org_DepPosiEmpl> Org_DepPosiEmpls { get { return GetCollection<Org_DepPosiEmpl>("Org_DepPosiEmpls"); } }
        #endregion


        #region DepartmentID
        private Org_Department _DepartmentID;

        [Association("Org_Department-Org_DepPositions")]
        [Persistent("DepartmentID")]
        public Org_Department BelongDepartment
        {
            get
            {
                return _DepartmentID;
            }
            set
            {
                SetPropertyValue("BelongDepartment", ref _DepartmentID, value);
            }
        }
        #endregion


        #region PositionID
        private Org_Position _PositionID;

        [Association("Org_Position-Org_DepPositions")]
        [Persistent("PositionID")]
        public Org_Position BelongPosition
        {
            get
            {
                return _PositionID;
            }
            set
            {
                SetPropertyValue("BelongPosition", ref _PositionID, value);
            }
        }
        #endregion


        #region Status
        private string _Status = "";
        [DisplayName(GSyntax.Org_DepPosition.Status), Size(14)]
        public string Status
        {
            get
            {
                return _Status;
            }
            set
            {
                SetPropertyValue("Status", ref _Status, value);
            }
        }
        #endregion

    }
    }
	
